import type { UserInfo } from '@/apis/auth'
import type { UserPasswordUpdateReq, UserReq } from '@/apis/system/type'
import { http } from '@/utils/http'

const BASE_URL = '/system/user'

/** @desc 修改用户 */
export function updateUser(data: UserReq, id: string) {
  return http.put<UserInfo>(`${BASE_URL}/${id}`, data)
}
/** @desc 重置密码 */
export function resetUserPwd(data: UserPasswordUpdateReq, id: string) {
  return http.patch<UserInfo>(`${BASE_URL}/${id}/password`, data)
}
